<?php
header('Content-Type:text/html;charset=utf-8');
$list = array(
    '市场部' => array(
        array('1', '高某', '市场部经理', '5000'),
        array('2', '罗某', '职员', '3000'),
        array('3', '周某', '职员', '2400')
    ),
    '产品部' => array(
        array('1', '高某', '产品部经理', '6000'),
        array('2', '罗某', '职员', '4000'),
        array('3', '周某', '职员', '2300')
    ),
    '财务部' => array(
        array('1', '高某', '财务部经理', '6000'),
        array('2', '罗某', '职员', '4000'),
        array('3', '周某', '职员', '2300')
    ),
);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table border="1" cellspacing="0" cellpadding="5">
        <tr>
            <th>部门</th>
            <th>编号</th>
            <th>姓名</th>
            <th>职务</th>
            <th>工资</th>
        </tr>
        <?php
        foreach ($list as $department => $employees) {
            foreach ($employees as $employee) {
                echo "<tr>";
                echo "<td>{$department}</td>";
                echo "<td>{$employee[0]}</td>";
                echo "<td>{$employee[1]}</td>";
                echo "<td>{$employee[2]}</td>";
                echo "<td>{$employee[3]}</td>";
                echo "</tr>";
            }
        }
        ?>
    </table>
</body>
</html>
